home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / AMScen_0_9.lha / AMScen / squirrel.m < prev    next >
Text File  |  1995-01-21  |  56KB  |  1,556 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1995 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * squirrel.m - a little quest.
  9.  */
  10.  
  11. use t_streets
  12.  
  13. private tp_squirrel CreateTable().
  14. use tp_squirrel
  15.  
  16. define tp_squirrel r_squirrelValley CreateThing(r_forest).
  17. AutoGraphics(r_squirrelValley, AutoOpenSpace).
  18. AutoPens(r_squirrelValley, C_FOREST_GREEN, C_GREEN, 0, 0).
  19. SetThingStatus(r_squirrelValley, ts_readonly).
  20.  
  21. define tp_squirrel p_rIsTrunk CreateBoolProp().
  22. define tp_squirrel p_rIsBranch CreateBoolProp().
  23. define tp_squirrel p_rTopTrunk CreateBoolProp().
  24. define tp_squirrel p_rSquirrelPath CreateThingProp().
  25. define tp_squirrel p_objects CreateThingListProp().
  26. define tp_squirrel p_tapes CreateThingListProp().
  27. define tp_squirrel p_rSquirrelUser CreateThingProp().
  28. define tp_squirrel p_mMoving CreateBoolProp().
  29. define tp_squirrel p_pSaveOldIdle CreateActionProp().
  30. define tp_squirrel p_pSquirrelWord CreateStringProp().
  31. define tp_squirrel p_rFirstWrap CreateBoolProp().
  32.  
  33. define tp_squirrel Squirrel CreateThing(nil).
  34. define tp_squirrel squirrelThing CreateThing(nil).
  35. define tp_squirrel r_valley13 CreateThing(r_squirrelValley).
  36. define tp_squirrel r_alcove CreateThing(r_indoors).
  37. define tp_squirrel o_bugTape CreateThing(nil).
  38. define tp_squirrel o_wad CreateThing(nil).
  39. define tp_squirrel o_weed CreateThing(nil).
  40.  
  41. SetThingStatus(squirrelThing, ts_readonly).
  42. squirrelThing@p_objects := CreateThingList().
  43. squirrelThing@p_tapes := CreateThingList().
  44. squirrelThing@p_rFirstWrap := true.
  45.  
  46. /* the basic movement routine for the squirrel */
  47.  
  48. define tp_squirrel proc notifyPlayer(string message)void:
  49.     thing who;
  50.  
  51.     who := squirrelThing@p_rSquirrelUser;
  52.     if who ~= nil then
  53.     SPrint(who, message);
  54.     fi;
  55. corp;
  56.  
  57. define tp_squirrel proc squirrelStep()void:
  58.     thing me, here, there, userLoc;
  59.     int dir, firstDir, leapCount;
  60.     bool keepMoving;
  61.     string s;
  62.  
  63.     me := Me();
  64.     here := Here();
  65.     if squirrelThing@p_rSquirrelUser = nil then
  66.     userLoc := r_alcove;        /* somewhere she never goes */
  67.     else
  68.     userLoc := AgentLocation(squirrelThing@p_rSquirrelUser);
  69.     fi;
  70.     keepMoving := true;
  71.     if here ~= r_valley13 then
  72.     /* try to move on a branch */
  73.     dir := Random(8);   /* 0 = D_NORTH ... 7 = D_NORTHWEST */
  74.     firstDir := dir;
  75.     while
  76.         there := here@(DirProp(dir));
  77.         if there ~= nil and userLoc ~= there and
  78.         not FindChildOnList(there@p_rContents, o_bugTape)
  79.         then
  80.         SetLocation(there);
  81.         notifyPlayer("The squirrel hops cutely to " +
  82.             DirName(dir) + " along a branch.\n");
  83.         keepMoving := false;
  84.         else
  85.         if dir = D_NORTHWEST then
  86.             dir := D_NORTH;
  87.         else
  88.             dir := dir + 1;
  89.         fi;
  90.         fi;
  91.         keepMoving and dir ~= firstDir
  92.     do
  93.     od;
  94.     fi;
  95.     if keepMoving then
  96.     /* cannot go out on a branch - try going up */
  97.     there := here@p_rUp;
  98.     if there ~= nil and userLoc ~= there and not here@p_rTopTrunk then
  99.         SetLocation(there);
  100.         notifyPlayer("The squirrel scampers pertly up the trunk.\n");
  101.         /* do NOT stop here */
  102.     elif here@p_rSquirrelPath ~= nil then
  103.         /* Leaping down the tree. Keep going until she hits the
  104.            ground, or a safe spot. */
  105.         leapCount := 1;
  106.         there := here;
  107.         while
  108.         there := there@p_rSquirrelPath;
  109.         FindChildOnList(there@p_rContents, o_bugTape) or
  110.             userLoc = there
  111.         do
  112.         leapCount := leapCount + 1;
  113.         od;
  114.         SetLocation(there);
  115.         if here@p_rIsTrunk then
  116.         s := "The squirrel climbs up to the small topmost branches, "
  117.             "takes ";
  118.         else
  119.         s := "The squirrel runs out on the smaller branches, takes ";
  120.         fi;
  121.         if leapCount = 1 then
  122.         s := s + "a graceful leap";
  123.         else
  124.         s := s + IntToString(leapCount) + " graceful leaps";
  125.         fi;
  126.         s := s + ", and lands on ";
  127.         if not there@p_rIsBranch then
  128.         s := s + "the ground. From there, she trots to the base "
  129.             "of the tree.\n";
  130.         SetLocation(r_valley13);
  131.         else
  132.         s := s + "a branch lower down.\n";
  133.         SetLocation(there);
  134.         fi;
  135.         notifyPlayer(s);
  136.         /* she does NOT stop in either case */
  137.     else
  138.         /* she is trapped! */
  139.         keepMoving := false;
  140.         SetLocation(nil);
  141.         s := "";
  142.         for leapCount from 1 upto 4 + Random(4) do
  143.         s := s + SubString("intrepdulpedardrittolvyeootbik",
  144.                    3 * Random(10), 3);
  145.         od;
  146.         squirrelThing@p_rSquirrelUser@p_pSquirrelWord := s;
  147.         notifyPlayer("You have trapped the squirrel! She looks at you "
  148.         "with evident alarm, whispers '" + s + "' to you and then "
  149.         "takes an impossible leap down the tree and vanishes!\n");
  150.     fi;
  151.     fi;
  152.     Squirrel@p_mMoving := keepMoving;
  153. corp;
  154.  
  155. define tp_squirrel proc noMove()void:
  156. corp;
  157.  
  158. Squirrel@p_pStandard := true.
  159. Squirrel@p_mMoving := false.
  160. SetupMachine(Squirrel).
  161. CreateMachine("Squirrel", Squirrel, r_valley13, noMove).
  162.  
  163. define tp_squirrel proc doStep()status:
  164.     squirrelStep();
  165.     continue
  166. corp;
  167.  
  168. /* a leave checker in use in this area */
  169.  
  170. define tp_squirrel proc squirrelLeaveChecker(int dir)status:
  171.     thing place;
  172.  
  173.     place := Here();
  174.     if dir = D_UP then
  175.     if AgentLocation(Squirrel) = place@p_rUp then
  176.         /* climbing up to the squirrel - move her */
  177.         ignore ForceAction(Squirrel, doStep);
  178.     fi;
  179.     continue
  180.     else
  181.     place := place@(DirProp(dir));
  182.     if FindChildOnList(place@p_rContents, o_bugTape) and place@p_rIsBranch
  183.     then
  184.         Print("There is no way you are going to crawl onto that sticky "
  185.         "bug tape over there!\n");
  186.         fail
  187.     else
  188.         if AgentLocation(Squirrel) = place then
  189.         if place = r_valley13 then
  190.             Print(
  191.             "As you walk towards the tree, you notice a squirrel "
  192.             "under it watching you. She is the prettiest squirrel "
  193.             "you have ever seen, with a cute nose, innocent blue "
  194.             "eyes and soft, deep fur. Most prominent of all, "
  195.             "however, is her gorgeous tail, rising in a graceful "
  196.             "curve over her back.\n");
  197.         fi;
  198.         /* crawling out to the squirrel - move her */
  199.         ignore ForceAction(Squirrel, doStep);
  200.         fi;
  201.         continue
  202.     fi
  203.     fi
  204. corp;
  205.  
  206. /* an enter checker in use for this area (called AFTER the leave checker) */
  207.  
  208. define tp_squirrel proc squirrelEnterChecker()status:
  209.  
  210.     while Squirrel@p_mMoving do
  211.     ignore ForceAction(Squirrel, doStep);
  212.     od;
  213.     continue
  214. corp;
  215.  
  216. /* a proc to reset this quest when the user of it leaves */
  217.  
  218. define tp_squirrel proc resetSquirrelStuff()void:
  219.     list thing lt;
  220.     int count, i;
  221.     thing me, th;
  222.  
  223.     me := Me();
  224.     squirrelThing -- p_rSquirrelUser;
  225.     squirrelThing@p_rFirstWrap := true;
  226.     SetAgentLocation(Squirrel, r_valley13);
  227.     ResetObjects(squirrelThing@p_objects);
  228.     RemoveAllFromInventory(me, o_bugTape);
  229.     RemoveAllFromInventory(me, o_wad);
  230.     RemoveAllFromInventory(me, o_weed);
  231.     lt := squirrelThing@p_tapes;
  232.     count := Count(lt);
  233.     while count ~= 0 do
  234.     count := count - 1;
  235.     th := lt[count];
  236.     if th@p_oWhere ~= nil then
  237.         /* Could be a weed that was being carried, so we will already
  238.            have 'ClearThing'ed it, etc. above; just need to delete it
  239.            from the tapes list. */
  240.         DelElement(th@p_oWhere@p_rContents, th);
  241.         ClearThing(th);
  242.     fi;
  243.     DelElement(lt, th);
  244.     od;
  245.     DelPlayerLeaveChecker(me, squirrelLeaveChecker);
  246.     DelPlayerEnterChecker(me, squirrelEnterChecker);
  247. corp;
  248.  
  249. /* an idle handler for this area */
  250.  
  251. define tp_squirrel proc squirrelIdle()void:
  252.     action a;
  253.  
  254.     resetSquirrelStuff();
  255.     a := Me()@p_pSaveOldIdle;
  256.     ignore SetCharacterIdleAction(a);
  257.     Me() -- p_pSaveOldIdle;
  258.     SetLocation(r_alcove);
  259.     if a ~= nil then
  260.     call(a, void)();
  261.     fi;
  262. corp;
  263.  
  264.  
  265. /* the squirrel quest */
  266.  
  267. define tp_squirrel proc checkWord(string word)bool:
  268.  
  269.     if word == It()@p_pSquirrelWord then
  270.     It() -- p_pSquirrelWord;
  271.     true
  272.     else
  273.     false
  274.     fi
  275. corp;
  276.  
  277. define tp_squirrel proc squirrelDesc()string:
  278.     "Tell me the secret word that the squirrel knows."
  279. corp;
  280.  
  281. define tp_squirrel proc squirrelHint()string:
  282.     "Bushes and trees are not always as impassable as they seem."
  283. corp;
  284.  
  285. QuestTell("Squirrel", squirrelDesc, checkWord, squirrelHint).
  286.  
  287.  
  288. /* link us to the pre-existing stuff */
  289.  
  290. r_ewTrail2@p_rNorthMessage :=
  291.     "You are able to push your way through the trees, and down into a gully.".
  292. r_ewTrail2@p_rNorthOMessage := "heads into the trees.".
  293. r_ewTrail2@p_rNorthEMessage := "comes out of the trees.".
  294.  
  295. define tp_squirrel proc treesImpassable()status:
  296.     Print("The growth here is too thick for you to get through.\n");
  297.     fail
  298. corp;
  299. AddNorthChecker(r_ewTrail3, treesImpassable, false).
  300. HUniConnect(r_ewTrail3, r_ewTrail3, D_NORTH).
  301.  
  302. define tp_squirrel r_gully1 CreateThing(r_outdoors).
  303. SetupRoom(r_gully1, "at the west end of a gully",
  304.     "The gully dead-ends here. A vague trail heads east down the gully, but "
  305.     "the west end is completely blocked by a tangle of bushes, trees and "
  306.     "rose thorns. The north bank is similarly blocked, but you might be "
  307.     "able to make it up the south bank.").
  308. r_gully1@p_rNoMachines := true.
  309. HConnect(r_ewTrail2, r_gully1, D_NORTH).
  310. HUniConnect(r_gully1, r_ewTrail2, D_UP).
  311. HUniConnect(r_gully1, r_ewTrail2, D_EXIT).
  312. AutoGraphics(r_gully1, AutoPaths).
  313. Scenery(r_gully1, "trail;vague.thorn,bush,bushes,tree;rose,tangle,of").
  314. r_gully1@p_rSouthMessage :=
  315.     "You are able to push your way through the trees, "
  316.     "and up out of the gully.".
  317. r_gully1@p_rSouthOMessage := "heads up out of the gully.".
  318. r_gully1@p_rSouthEMessage := "comes out of the trees.".
  319. r_gully1@p_rUpMessage :=
  320.     "You are able to push your way through the trees, "
  321.     "and up out of the gully.".
  322. r_gully1@p_rUpOMessage := "heads up out of the gully.".
  323. r_gully1@p_rUpEMessage := "comes out of the trees.".
  324. r_gully1@p_rExitMessage :=
  325.     "You are able to push your way through the trees, "
  326.     "and up out of the gully.".
  327. r_gully1@p_rExitOMessage := "heads up out of the gully.".
  328. r_gully1@p_rExitEMessage := "comes out of the trees.".
  329.  
  330. define tp_squirrel r_gully2 CreateThing(r_outdoors).
  331. SetupRoom(r_gully2, "on a vague trail in a gully",
  332.     "The trail makes a bend here, heading west and northeast. You can't "
  333.     "really see much of the gully because of the thick bushes and trees "
  334.     "along both sides of the trail.").
  335. Connect(r_gully1, r_gully2, D_EAST).
  336. AddSouthChecker(r_gully2, treesImpassable, false).
  337. HUniConnect(r_gully2, r_gully2, D_SOUTH).
  338. AddNorthChecker(r_gully2, treesImpassable, false).
  339. HUniConnect(r_gully2, r_gully2, D_NORTH).
  340. AddEastChecker(r_gully2, treesImpassable, false).
  341. HUniConnect(r_gully2, r_gully2, D_EAST).
  342. AddNorthWestChecker(r_gully2, treesImpassable, false).
  343. HUniConnect(r_gully2, r_gully2, D_NORTHWEST).
  344. AddSouthEastChecker(r_gully2, treesImpassable, false).
  345. HUniConnect(r_gully2, r_gully2, D_SOUTHEAST).
  346. AddSouthWestChecker(r_gully2, treesImpassable, false).
  347. HUniConnect(r_gully2, r_gully2, D_SOUTHWEST).
  348. AutoGraphics(r_gully2, AutoPaths).
  349. Scenery(r_gully2, "bush,bushes,tree;thick").
  350.  
  351. define tp_squirrel r_gully3 CreateThing(r_outdoors).
  352. SetupRoom(r_gully3, "on a vague trail in a gully",
  353.     "The trail makes a bend here, heading southwest and southeast. You can't "
  354.     "really see much of the gully because of the thick bushes and trees "
  355.     "along both sides of the trail.").
  356. Connect(r_gully2, r_gully3, D_NORTHEAST).
  357. AddSouthChecker(r_gully3, treesImpassable, false).
  358. HUniConnect(r_gully3, r_gully3, D_SOUTH).
  359. AddEastChecker(r_gully3, treesImpassable, false).
  360. HUniConnect(r_gully3, r_gully3, D_EAST).
  361. AddWestChecker(r_gully3, treesImpassable, false).
  362. HUniConnect(r_gully3, r_gully3, D_WEST).
  363. AddNorthWestChecker(r_gully3, treesImpassable, false).
  364. HUniConnect(r_gully3, r_gully3, D_NORTHWEST).
  365. AddNorthEastChecker(r_gully3, treesImpassable, false).
  366. HUniConnect(r_gully3, r_gully3, D_NORTHEAST).
  367. AutoGraphics(r_gully3, AutoPaths).
  368. Scenery(r_gully3, "bush,bushes,tree;thick").
  369. r_gully3@p_rNorthMessage :=
  370.     "You are able to push your way through the undergrowth, "
  371.     "and into a small side gully.".
  372. r_gully3@p_rNorthOMessage := "heads into the undergrowth to the north.".
  373. r_gully3@p_rNorthEMessage := "comes out of the undergrowth to the north.".
  374.  
  375. define tp_squirrel r_gully4 CreateThing(r_outdoors).
  376. SetupRoom(r_gully4, "at the southeast end of a gully",
  377.     "The trail and the gully end here. This end is also completely blocked "
  378.     "by growth, but you might be able to struggle up to the south.").
  379. Connect(r_gully3, r_gully4, D_SOUTHEAST).
  380. Scenery(r_gully4, "bush,bushes,tree,growth;thick").
  381. define tp_squirrel proc treesAttempt()status:
  382.     if Random(3) = 0 then
  383.     Print("You are able to bull your way through the undergrowth, and "
  384.         "up out of the gully.\n");
  385.     succeed
  386.     else
  387.     Print("You are unable to penetrate the thick undergrowth. You end "
  388.         "up back on the trail, but with a few scratches.\n");
  389.     fail
  390.     fi
  391. corp;
  392. AddSouthChecker(r_gully4, treesAttempt, false).
  393. HUniConnect(r_gully4, r_pearField, D_SOUTH).
  394. AutoGraphics(r_gully4, AutoPaths).
  395.  
  396. define tp_squirrel r_gully5 CreateThing(r_outdoors).
  397. SetupRoom(r_gully5, "on a very vague trail in a side gully",
  398.     "The main gully is through the bushes to the south, and the side "
  399.     "trail continues around a bend to the northeast.").
  400. HUniConnect(r_gully3, r_gully5, D_NORTH).
  401. UniConnect(r_gully5, r_gully3, D_SOUTH).
  402. AutoGraphics(r_gully5, AutoPaths).
  403. Scenery(r_gully5, "bush,bushes,tree,thick").
  404.  
  405. define tp_squirrel r_gully6 CreateThing(r_outdoors).
  406. SetupRoom(r_gully6, "at the end of the side gully",
  407.     "This side gully ends here in a rocky alcove. You can see what appears "
  408.     "to be a dark cave to the east. The gully trail goes back southwest.").
  409. Connect(r_gully5, r_gully6, D_NORTHEAST).
  410. AutoGraphics(r_gully6, AutoPaths).
  411. Scenery(r_gully6, "alcove;rocky.cave;dark,floor,walls").
  412.  
  413. /* the alcove is actually defined above */
  414. SetupRoom(r_alcove, "in a dim rocky alcove",
  415.     "The alcove is quite low, so that you have to stoop slightly. The light "
  416.     "of day is to the west, but more interesting is the stout wooden door "
  417.     "to the east.").
  418. Connect(r_gully6, r_alcove, D_EAST).
  419. Connect(r_gully6, r_alcove, D_ENTER).
  420. define tp_squirrel SQ_ALCOVE_ID NextEffectId().
  421. define tp_squirrel proc alcoveDraw()void:
  422.  
  423.     if not KnowsEffect(nil, SQ_ALCOVE_ID) then
  424.     DefineEffect(nil, SQ_ALCOVE_ID);
  425.     GSetImage(nil, "sq_alcove");
  426.     IfFound(nil);
  427.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  428.     Else(nil);
  429.         GSetPen(nil, C_MEDIUM_GREY);
  430.         GAMove(nil, 0, 0);
  431.         GRectangle(nil, 159, 99, true);
  432.         GSetPen(nil, C_TAN);
  433.         GAMove(nil, 19, 19);
  434.         GRectangle(nil, 121, 61, false);
  435.         GSetPen(nil, C_BLACK);
  436.         GAMove(nil, 20, 20);
  437.         GRectangle(nil, 119, 59, true);
  438.         GSetPen(nil, C_MEDIUM_GREY);
  439.         GAMove(nil, 0, 40);
  440.         GRectangle(nil, 0, 19, true);
  441.         GSetPen(nil, C_TAN);
  442.         GAMove(nil, 0, 40);
  443.         GRDraw(nil, 19, 0);
  444.         GAMove(nil, 0, 60);
  445.         GRDraw(nil, 19, 0);
  446.         GSetPen(nil, C_BLACK);
  447.         GAMove(nil, 0, 41);
  448.         GRectangle(nil, 20, 18, true);
  449.         GSetPen(nil, C_BROWN);
  450.         GAMove(nil, 140, 46);
  451.         VerticalDoor();
  452.     Fi(nil);
  453.     EndEffect();
  454.     fi;
  455.     CallEffect(nil, SQ_ALCOVE_ID);
  456. corp;
  457. AutoGraphics(r_alcove, alcoveDraw).
  458.  
  459. define tp_squirrel proc gullyDoorEnter()status:
  460.     thing me, who;
  461.  
  462.     me := Me();
  463.     who := squirrelThing@p_rSquirrelUser;
  464.     if Character(me@p_pName) = nil then
  465.     OPrint(FormatName(me@p_pName) + " will not enter.\n");
  466.     fail
  467.     elif who = nil then
  468.     squirrelThing@p_rSquirrelUser := me;
  469.     Print("The door quietly opens and you enter a small antechamber.\n"
  470.         "NOTE: no-one else can enter this quest area while you are in "
  471.         "it - please keep your stay as short as possible. Thank-you.\n");
  472.     me@p_pSaveOldIdle := SetCharacterIdleAction(squirrelIdle);
  473.     AddPlayerLeaveChecker(me, squirrelLeaveChecker, false);
  474.     AddPlayerEnterChecker(me, squirrelEnterChecker, false);
  475.     continue
  476.     else
  477.     Print("The door is locked - you cannot enter. This quest area is "
  478.         "currently in use by " + FormatName(who@p_pName) + ".\n");
  479.     fail
  480.     fi
  481. corp;
  482.  
  483. define tp_squirrel proc gullyDoorExit()status:
  484.  
  485.     Print("You open the door and go outside.\n");
  486.     ignore SetCharacterIdleAction(Me()@p_pSaveOldIdle);
  487.     Me() -- p_pSaveOldIdle;
  488.     resetSquirrelStuff();
  489.     Print("This quest area is now available for other players.\n");
  490.     continue
  491. corp;
  492.  
  493. define tp_squirrel o_alcoveDoor CreateThing(nil).
  494. FakeModel(o_alcoveDoor, "door;stout,wooden",
  495.     "The door is old, but in excellent condition. It appear to have been "
  496.     "hand made with great care.").
  497. o_alcoveDoor@p_oCloseString := "The door is already closed.".
  498. o_alcoveDoor@p_oNotLocked := true.
  499.  
  500. define tp_squirrel o_alcoveDoor1 CreateThing(o_alcoveDoor).
  501. SetThingStatus(o_alcoveDoor1, ts_readonly).
  502. define tp_squirrel proc openAlcoveDoor1()status:
  503.     ignore Parse(G, "in");
  504.     succeed
  505. corp;
  506. o_alcoveDoor1@p_oOpenChecker := openAlcoveDoor1.
  507. AddTail(r_alcove@p_rContents, o_alcoveDoor1).
  508.  
  509. define tp_squirrel r_antechamber CreateThing(r_indoors).
  510. SetupRoom(r_antechamber, "in a small antechamber",
  511.     "The decor here is overwhelmingly woody - the floor is small hardwood "
  512.     "tiles; the baseboard is a very dark, almost black wood; the lower "
  513.     "walls are mahogany panels; the upper walls are of knotty pine "
  514.     "panelling; and the ceiling is cedar boards. A narrow corridor leads "
  515.     "to the north, and a stout wooden door heads out to the west.").
  516. Connect(r_alcove, r_antechamber, D_EAST).
  517. Connect(r_alcove, r_antechamber, D_ENTER).
  518. define tp_squirrel SQ_ANTE_ID NextEffectId().
  519. define tp_squirrel proc antechamberDraw()void:
  520.  
  521.     if not KnowsEffect(nil, SQ_ANTE_ID) then
  522.     DefineEffect(nil, SQ_ANTE_ID);
  523.     GSetImage(nil, "sq_ante");
  524.     IfFound(nil);
  525.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  526.     Else(nil);
  527.         GSetPen(nil, C_MEDIUM_GREY);
  528.         GAMove(nil, 0, 0);
  529.         GRectangle(nil, 159, 99, true);
  530.         GSetPen(nil, C_TAN);
  531.         GAMove(nil, 19, 19);
  532.         GRectangle(nil, 121, 61, false);
  533.         GSetPen(nil, C_BLACK);
  534.         GAMove(nil, 20, 20);
  535.         GRectangle(nil, 119, 59, true);
  536.         GSetPen(nil, C_MEDIUM_GREY);
  537.         GAMove(nil, 66, 0);
  538.         GRectangle(nil, 27, 19, true);
  539.         GSetPen(nil, C_TAN);
  540.         GAMove(nil, 65, 0);
  541.         GRDraw(nil, 0, 19);
  542.         GAMove(nil, 94, 0);
  543.         GRDraw(nil, 0, 19);
  544.         GSetPen(nil, C_BLACK);
  545.         GAMove(nil, 66, 0);
  546.         GRectangle(nil, 27, 19, true);
  547.         GSetPen(nil, C_BROWN);
  548.         GAMove(nil, 19, 46);
  549.         VerticalDoor();
  550.     Fi(nil);
  551.     EndEffect();
  552.     fi;
  553.     CallEffect(nil, SQ_ANTE_ID);
  554. corp;
  555. AutoGraphics(r_antechamber, antechamberDraw).
  556. AddEastChecker(r_alcove, gullyDoorEnter, false).
  557. AddEnterChecker(r_alcove, gullyDoorEnter, false).
  558. AddWestChecker(r_antechamber, gullyDoorExit, false).
  559. AddExitChecker(r_antechamber, gullyDoorExit, false).
  560. Scenery(r_antechamber,
  561.     "door;small,stout,wooden."
  562.     "decor;woody."
  563.     "tile,floor;small,hardwood,tile."
  564.     "baseboard,board;dark,base,almost,black,wood,wooden."
  565.     "wall,panel,panelling;lower,mahogany,wall."
  566.     "wall,panel,panelling;upper,knotty,pine,wall."
  567.     "ceiling,board;cedar,board."
  568.     "corridor;narrow").
  569. define tp_squirrel o_alcoveDoor2 CreateThing(o_alcoveDoor).
  570. SetThingStatus(o_alcoveDoor2, ts_readonly).
  571. define tp_squirrel proc openAlcoveDoor2()status:
  572.     ignore Parse(G, "out");
  573.     succeed
  574. corp;
  575. o_alcoveDoor2@p_oOpenChecker := openAlcoveDoor2.
  576. AddTail(r_antechamber@p_rContents, o_alcoveDoor2).
  577. define tp_squirrel o_broom CreateThing(nil).
  578. SetupObject(o_broom, r_antechamber, "broom;straw",
  579.     "Straw brooms are typically used to sweep floors. They can also be used "
  580.     "for removing spiderwebs from ceiling corners. This one is nothing "
  581.     "special.").
  582. o_broom@p_oUseString :=
  583.     "Sweep, sweep, sweep. Hmm. Seems pretty clean around here already.".
  584. o_broom@p_oActWord := "sweep,brush,clean".
  585. o_broom@p_oActString :=
  586.     "Sweep, sweep, sweep. Hmm. Seems pretty clean around here already.".
  587. AddTail(squirrelThing@p_objects, o_broom).
  588. define tp_squirrel o_dustMop CreateThing(nil).
  589. SetupObject(o_dustMop, r_antechamber, "mop;dust",
  590.     "Dust mops are masses of fluffy strings attached to a long wooden handle. "
  591.     "They are good from removing light dust (like flour) from floors.").
  592. o_dustMop@p_oUseString := "There is no dust around here to mop up!".
  593. o_dustMop@p_oActWord := "mop,dust,clean".
  594. o_dustMop@p_oActString := "There is no dust around here to mop up!".
  595. AddTail(squirrelThing@p_objects, o_dustMop).
  596.  
  597. define tp_squirrel r_hallSouth CreateThing(r_indoors).
  598. SetupRoom(r_hallSouth, "in a north-south hallway",
  599.     "The hallway slopes down to the north.").
  600. Connect(r_antechamber, r_hallSouth, D_NORTH).
  601. AutoGraphics(r_hallSouth, AutoHalls).
  602.  
  603. define tp_squirrel r_hallCross CreateThing(r_indoors).
  604. SetupRoom(r_hallCross, "in a joining of hallways", "").
  605. Connect(r_hallSouth, r_hallCross, D_NORTH).
  606. AutoGraphics(r_hallCross, AutoHalls).
  607.  
  608. define tp_squirrel r_hallNorth CreateThing(r_indoors).
  609. SetupRoom(r_hallNorth, "in a north-south hallway",
  610.     "The hallway slopes down to the north.").
  611. Connect(r_hallCross, r_hallNorth, D_NORTH).
  612. AutoGraphics(r_hallNorth, AutoHalls).
  613.  
  614. define tp_squirrel r_kitchen CreateThing(r_indoors).
  615. SetupRoom(r_kitchen, "in a small kitchen",
  616.     "This is a very efficient kitchen, with everything within easy reach. "
  617.     "None of the equipment is modern, but it is all well-kept and spotlessly "
  618.     "clean. There is a hallway to the south and a door to the north.").
  619. Connect(r_hallNorth, r_kitchen, D_NORTH).
  620. define tp_squirrel SQ_KITCHEN_ID NextEffectId().
  621. define tp_squirrel proc kitchenDraw()void:
  622.  
  623.     if not KnowsEffect(nil, SQ_KITCHEN_ID) then
  624.     DefineEffect(nil, SQ_KITCHEN_ID);
  625.     GSetImage(nil, "sq_kitchen");
  626.     IfFound(nil);
  627.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  628.     Else(nil);
  629.         GSetPen(nil, C_MEDIUM_GREY);
  630.         GAMove(nil, 0, 0);
  631.         GRectangle(nil, 159, 99, true);
  632.         GSetPen(nil, C_TAN);
  633.         GAMove(nil, 19, 19);
  634.         GRectangle(nil, 121, 61, false);
  635.         GSetPen(nil, C_BLACK);
  636.         GAMove(nil, 20, 20);
  637.         GRectangle(nil, 119, 59, true);
  638.         GSetPen(nil, C_TAN);
  639.         GAMove(nil, 65, 80);
  640.         GRDraw(nil, 0, 19);
  641.         GAMove(nil, 94, 80);
  642.         GRDraw(nil, 0, 19);
  643.         GSetPen(nil, C_BLACK);
  644.         GAMove(nil, 66, 80);
  645.         GRectangle(nil, 27, 19, true);
  646.         GSetPen(nil, C_BROWN);
  647.         GAMove(nil, 75, 19);
  648.         HorizontalDoor();
  649.     Fi(nil);
  650.     EndEffect();
  651.     fi;
  652.     CallEffect(nil, SQ_KITCHEN_ID);
  653. corp;
  654. AutoGraphics(r_kitchen, kitchenDraw).
  655. Scenery(r_kitchen,
  656.     "equipment;well-kept,well,kept,spotlessly,clean."
  657.     "hallway,hall").
  658. define tp_squirrel o_rollingPin CreateThing(nil).
  659. SetupObject(o_rollingPin, r_kitchen, "pin;wooden,rolling",
  660.     "The rolling pin shows signs of much use, but is still perfectly good. "
  661.     "The traces of flour that you can see on it are quite dark, as if it "
  662.     "isn't normally used on grain flour.").
  663. o_rollingPin@p_oUseString :=
  664.     "Seeing as you are not currently making a pie, there is nothing "
  665.     "here for you to use the rolling pin on.".
  666. o_rollingPin@p_oActWord := "roll".
  667. o_rollingPin@p_oActString :=
  668.     "Seeing as you are not currently making a pie, there is nothing "
  669.     "here for you to use the rolling pin on.".
  670. AddTail(squirrelThing@p_objects, o_rollingPin).
  671. define tp_squirrel o_potHolder CreateThing(nil).
  672. SetupObject(o_potHolder, r_kitchen,
  673.     "holder;cloth,pot.potholder,pot-holder;cloth",
  674.     "The pot-holder has an embroidered design showing a brown furry person "
  675.     "sniffing a newly baked pie.").
  676. o_potHolder@p_oUseString :=
  677.     "You can fan yourself with the pretty pot-holder, but since there "
  678.     "aren't any hot pots around here for you to hold, that's about it.".
  679. o_potHolder@p_oActWord := "hold".
  680. o_potHolder@p_oActString :=
  681.     "You can fan yourself with the pretty pot-holder, but since there "
  682.     "aren't any hot pots around here for you to hold, that's about it.".
  683. AddTail(squirrelThing@p_objects, o_potHolder).
  684. define tp_squirrel o_fakeDoor CreateThing(nil).
  685. FakeObject(o_fakeDoor, r_kitchen, "door", "").
  686. o_fakeDoor@p_oNotLocked := true.
  687.  
  688. define tp_squirrel r_hallEast CreateThing(r_indoors).
  689. SetupRoom(r_hallEast, "in an east-west hallway", "").
  690. Connect(r_hallCross, r_hallEast, D_EAST).
  691. AutoGraphics(r_hallEast, AutoHalls).
  692.  
  693. define tp_squirrel r_livingRoom CreateThing(r_indoors).
  694. SetupRoom(r_livingRoom, "in a pleasant living room",
  695.     "The walls are of diagonal cedar boards here, while the "
  696.     "ceiling is of narrow oak strips and the floor is of smooth pine planks. "
  697.     "Wooden coffee tables hold bowls of nuts and light comes from a set of "
  698.     "diamond willow pole lamps. There is a hallway to the west.").
  699. Connect(r_hallEast, r_livingRoom, D_EAST).
  700. Connect(r_hallEast, r_livingRoom, D_ENTER).
  701. AutoGraphics(r_livingRoom, AutoOpenRoom).
  702. Scenery(r_livingRoom,
  703.     "wall,board;diagonal,cedar,board."
  704.     "ceiling,strip;narrow,oak,strip."
  705.     "floor,plank;smooth,pine,plank."
  706.     "table;wooden,wood,coffee."
  707.     "nut,bowl;bowls,of."
  708.     "lamp;set,of,diamond,willow,pole."
  709.     "hallway.door").
  710. define tp_squirrel o_couch CreateThing(nil).
  711. SetupObject(o_couch, r_livingRoom, "couch",
  712.     "The couch looks very comfortable and is covered in a soft fabric in "
  713.     "a subdued leaf green colour.").
  714. o_couch@p_oCanSitOn := 3.
  715. o_couch@p_oNotGettable := true.
  716. define tp_squirrel o_chair CreateThing(nil).
  717. SetupObject(o_chair, r_livingRoom, "chair,armchair,arm-chair;arm",
  718.     "The armchair is a perfect match for the couch, and looks just as "
  719.     "comfortable.").
  720. o_chair@p_oCanSitOn := 2.
  721. o_chair@p_oNotGettable := true.
  722. define tp_squirrel o_coffeeTable CreateThing(nil).
  723. SetupObject(o_coffeeTable, r_livingRoom, "table;wooden,coffee",
  724.     "The coffee table was carved from a single piece of wood, then smoothed "
  725.     "and varnished. It looks like it will last forever.").
  726. o_coffeeTable@p_oNotGettable := true.
  727.  
  728. define tp_squirrel r_hallWest CreateThing(r_indoors).
  729. SetupRoom(r_hallWest, "in an east-west hallway", "").
  730. Connect(r_hallCross, r_hallWest, D_WEST).
  731. AutoGraphics(r_hallWest, AutoHalls).
  732.  
  733. define tp_squirrel r_bedroom CreateThing(r_indoors).
  734. SetupRoom(r_bedroom, "in a cozy bedroom",
  735.     "A female hand shows itself here in the decor - the wooden four-poster "
  736.     "bed has a fluffy pink bedspread with ruffles, and the nearby dressing "
  737.     "table has a large mirror on top.").
  738. Connect(r_hallWest, r_bedroom, D_WEST).
  739. Connect(r_hallWest, r_bedroom, D_ENTER).
  740. AutoGraphics(r_bedroom, AutoOpenRoom).
  741. Scenery(r_bedroom,
  742.     "bedspread,ruffles;fluffy,pink,bedspread,with."
  743.     "table,mirror;nearby,dressing,with,mirror,table").
  744. define tp_squirrel o_bed CreateThing(nil).
  745. FakeObject(o_bed, r_bedroom,
  746.     "bed;wooden,four-poster.bed;wood,wooden,four-poster,four,poster",
  747.     "The bed looks very soft and inviting.").
  748. o_bed@p_oCanLieOn := 2.
  749. o_bed@p_oCanLieIn := 2.
  750. o_bed@p_oCanSitOn := 2.
  751. o_bed@p_oCanSitIn := 2.
  752. /* Let's be pedantic about the bed! */
  753. define tp_squirrel proc bedSit(int whichPos)status:
  754.     case whichPos
  755.     incase POS_LIE_ON:
  756.     Print("You lie on the bed and almost fall asleep - the bed is VERY "
  757.         "comfortable.\n");
  758.     succeed
  759.     incase POS_LIE_IN:
  760.     Print("Lying on the bed would be OK, but it isn't very nice to get "
  761.         "into someone else's bed without their permission.\n");
  762.     fail
  763.     incase POS_SIT_ON:
  764.     continue
  765.     incase POS_SIT_IN:
  766.     Print("You can sit on the bed, but sitting in it would be a neat "
  767.         "trick.\n");
  768.     fail
  769.     default:
  770.     fail
  771.     esac
  772. corp;
  773. o_bed@p_oPositionChecker := bedSit.
  774. define tp_squirrel o_hairBrush CreateThing(nil).
  775. SetupObject(o_hairBrush, r_bedroom, "brush;hair",
  776.     "The hair brush contains some short light-brown hairs, and also a "
  777.     "few much longer hairs of a reddish hue.").
  778. o_hairBrush@p_oUseString := "Ouch! Those tangles are fighting back!".
  779. o_hairBrush@p_oActWord := "brush,comb".
  780. o_hairBrush@p_oActString := "Ouch! Those tangles are fighting back!".
  781. AddTail(squirrelThing@p_objects, o_hairBrush).
  782. define tp_squirrel o_handMirror CreateThing(nil).
  783. SetupObject(o_handMirror, r_bedroom,
  784.         "mirror;hand.mirror;self,myself,me,in,hand", "").
  785. define tp_squirrel proc mirrorLook()string:
  786.     thing me;
  787.     action a;
  788.     string s, name;
  789.  
  790.     me := Me();
  791.     name := FormatName(me@p_pName);
  792.     a := me@p_pDescAction;
  793.     if a ~= nil then
  794.     s := call(a, string)();
  795.     else
  796.     s := me@p_pDesc;
  797.     if s = "" then
  798.         s := name + " has no description - for shame!";
  799.     fi;
  800.     fi;
  801.     "You can see " + name + " in the mirror. " + s
  802. corp;
  803. o_handMirror@p_oDescAction := mirrorLook.
  804. define tp_squirrel proc mirrorUse()status:
  805.     Print(mirrorLook() + "\n");
  806.     succeed
  807. corp;
  808. o_handMirror@p_oUseChecker := mirrorUse.
  809. AddTail(squirrelThing@p_objects, o_handMirror).
  810.  
  811. define tp_squirrel r_valley1 CreateThing(r_forest).
  812. SetupRoom(r_valley1, "at the south end of a narrow valley",
  813.     "The valley is quite narrow here, and the sides are too steep to climb. "
  814.     "There is a pretty wooden door in the very end of the valley.").
  815. Connect(r_kitchen, r_valley1, D_NORTH).
  816. AddTail(r_valley1@p_rContents, o_fakeDoor).
  817. define tp_squirrel SQ_VALLEY1_ID NextEffectId().
  818. define tp_squirrel proc valley1Draw()void:
  819.  
  820.     if not KnowsEffect(nil, SQ_VALLEY1_ID) then
  821.     DefineEffect(nil, SQ_VALLEY1_ID);
  822.     GSetImage(nil, "sq_valley1");
  823.     IfFound(nil);
  824.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  825.     Else(nil);
  826.         GSetPen(nil, C_GREEN);
  827.         GAMove(nil, 20, 0);
  828.         GRectangle(nil, 119, 79, true);
  829.         GSetPen(nil, C_FOREST_GREEN);
  830.         GAMove(nil, 0, 0);
  831.         GRectangle(nil, 19, 99, true);
  832.         GAMove(nil, 140, 0);
  833.         GRectangle(nil, 19, 99, true);
  834.         GAMove(nil, 20, 80);
  835.         GRectangle(nil, 119, 19, true);
  836.         GSetPen(nil, C_BROWN);
  837.         GAMove(nil, 75, 80);
  838.         HorizontalDoor();
  839.     Fi(nil);
  840.     EndEffect();
  841.     fi;
  842.     CallEffect(nil, SQ_VALLEY1_ID);
  843. corp;
  844. AutoGraphics(r_valley1, valley1Draw).
  845. Scenery(r_valley1, "door;pretty,wooden,wood").
  846.  
  847. define tp_squirrel o_oakTree CreateThing(nil).
  848. FakeModel(o_oakTree, "tree;magnificent,old,oak.oak;magnificent,old",
  849.     "The oak is obviously very old, but is still in excellent health. It "
  850.     "has many large branches full of luxuriant foliage. You can, however, "
  851.     "glimpse a broken branch up near the top.").
  852.  
  853. define tp_squirrel r_valley2 CreateThing(r_squirrelValley).
  854. SetupRoom(r_valley2, "in a grassy valley",
  855.     "The valley widens here to the northeast and northwest, while a narrow "
  856.     "end goes south. The center of the valley contains a magnificent old "
  857.     "oak tree.").
  858. Connect(r_valley1, r_valley2, D_NORTH).
  859. AddTail(r_valley2@p_rContents, o_oakTree).
  860.  
  861. define tp_squirrel r_valley3 CreateThing(r_squirrelValley).
  862. SetupRoom(r_valley3, "in the southwest corner of the valley",
  863.     "The narrow southern end is to the southeast and the oak is northeast.").
  864. Connect(r_valley2, r_valley3, D_NORTHWEST).
  865. AddTail(r_valley3@p_rContents, o_oakTree).
  866.  
  867. define tp_squirrel r_valley4 CreateThing(r_squirrelValley).
  868. SetupRoom(r_valley4, "in the southern part of the valley", "").
  869. Connect(r_valley2, r_valley4, D_NORTH).
  870. Connect(r_valley3, r_valley4, D_EAST).
  871. AddTail(r_valley4@p_rContents, o_oakTree).
  872.  
  873. define tp_squirrel r_valley5 CreateThing(r_squirrelValley).
  874. SetupRoom(r_valley5, "in the southeast corner of the valley",
  875.     "The narrow southern end is to the southwest and the oak is northwest.").
  876. Connect(r_valley2, r_valley5, D_NORTHEAST).
  877. Connect(r_valley4, r_valley5, D_EAST).
  878. AddTail(r_valley5@p_rContents, o_oakTree).
  879.  
  880. define tp_squirrel r_valley6 CreateThing(r_squirrelValley).
  881. SetupRoom(r_valley6, "in the valley, west of the old oak", "").
  882. Connect(r_valley3, r_valley6, D_NORTH).
  883. Connect(r_valley4, r_valley6, D_NORTHWEST).
  884. RoomName(r_valley5, "Valley", "").
  885. AddTail(r_valley6@p_rContents, o_oakTree).
  886.  
  887. define tp_squirrel r_valley7 CreateThing(r_squirrelValley).
  888. SetupRoom(r_valley7, "in the valley, east of the magnificent oak", "").
  889. RoomName(r_valley7, "Valley", "").
  890. Connect(r_valley5, r_valley7, D_NORTH).
  891. Connect(r_valley4, r_valley7, D_NORTHEAST).
  892. AddTail(r_valley7@p_rContents, o_oakTree).
  893.  
  894. define tp_squirrel r_valley8 CreateThing(r_squirrelValley).
  895. SetupRoom(r_valley8, "in the northwest corner of the valley",
  896.     "The narrow northern end is to the northeast and the oak is southeast.").
  897. Connect(r_valley6, r_valley8, D_NORTH).
  898. AddTail(r_valley8@p_rContents, o_oakTree).
  899.  
  900. define tp_squirrel r_valley9 CreateThing(r_squirrelValley).
  901. SetupRoom(r_valley9, "in the northern part of the valley", "").
  902. Connect(r_valley6, r_valley9, D_NORTHEAST).
  903. Connect(r_valley8, r_valley9, D_EAST).
  904. Connect(r_valley7, r_valley9, D_NORTHWEST).
  905. AddTail(r_valley9@p_rContents, o_oakTree).
  906.  
  907. define tp_squirrel r_valley10 CreateThing(r_squirrelValley).
  908. SetupRoom(r_valley10, "in the northeast corner of the valley",
  909.     "The narrow northern end is to the northwest and the oak is southwest.").
  910. Connect(r_valley7, r_valley10, D_NORTH).
  911. Connect(r_valley9, r_valley10, D_EAST).
  912. AddTail(r_valley10@p_rContents, o_oakTree).
  913.  
  914. define tp_squirrel r_valley11 CreateThing(r_squirrelValley).
  915. SetupRoom(r_valley11, "in the northern branch of the valley",
  916.     "The valley opens out to the southeast and southwest, but to the north "
  917.     "is only a very narrow portion.").
  918. Connect(r_valley8, r_valley11, D_NORTHEAST).
  919. Connect(r_valley9, r_valley11, D_NORTH).
  920. Connect(r_valley10, r_valley11, D_NORTHWEST).
  921. AddTail(r_valley11@p_rContents, o_oakTree).
  922.  
  923. define tp_squirrel r_valley12 CreateThing(r_forest).
  924. SetupRoom(r_valley12, "at the north end of the valley",
  925.     "There is a small shed tucked into the end of the valley.").
  926. Connect(r_valley11, r_valley12, D_NORTH).
  927. Scenery(r_valley12, "shed;small").
  928. AddTail(r_valley12@p_rContents, o_fakeDoor).
  929. define tp_squirrel SQ_VALLEY12_ID NextEffectId().
  930. define tp_squirrel proc valley12Draw()void:
  931.  
  932.     if not KnowsEffect(nil, SQ_VALLEY12_ID) then
  933.     DefineEffect(nil, SQ_VALLEY12_ID);
  934.     GSetImage(nil, "sq_valley12");
  935.     IfFound(nil);
  936.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  937.     Else(nil);
  938.         GSetPen(nil, C_GREEN);
  939.         GAMove(nil, 20, 20);
  940.         GRectangle(nil, 119, 79, true);
  941.         GSetPen(nil, C_FOREST_GREEN);
  942.         GAMove(nil, 0, 0);
  943.         GRectangle(nil, 19, 99, true);
  944.         GAMove(nil, 140, 0);
  945.         GRectangle(nil, 19, 99, true);
  946.         GAMove(nil, 20, 0);
  947.         GRectangle(nil, 119, 19, true);
  948.         GSetPen(nil, C_DARK_BLUE);
  949.         GAMove(nil, 70, 25);
  950.         GRectangle(nil, 20, 15, true);
  951.         GSetPen(nil, C_RED);
  952.         GAMove(nil, 75, 40);
  953.         HorizontalDoor();
  954.     Fi(nil);
  955.     EndEffect();
  956.     fi;
  957.     CallEffect(nil, SQ_VALLEY12_ID);
  958. corp;
  959. AutoGraphics(r_valley12, valley12Draw).
  960.  
  961. /* o_weed is created earlier */
  962. o_weed@p_oName := "weed;ugly,dead".
  963. o_weed@p_oDesc :=
  964.     "The weed looks freshly hoed up - it is still quite green and there is "
  965.     "a lump of dirt stuck on its roots.".
  966. o_weed@p_oEatString := "Yuck! The weed might be poisonous!".
  967. o_weed@p_oSmellString := "The weed smells slightly minty, and mostly dirty.".
  968. o_weed@p_oPullString := "The weed is already pulled!".
  969. o_weed@p_oUseString := "Most weeds are considered to be useless.".
  970. o_weed@p_oActWord := "smoke".
  971. o_weed@p_oActString := "Sorry, its not that kind of weed!".
  972. SetThingStatus(o_weed, ts_readonly).
  973.  
  974. define tp_squirrel r_shed CreateThing(r_indoors).
  975. SetupRoom(r_shed, "in the garden shed",
  976.     "This small wooden structure is used for storage of various garden tools. "
  977.     "It is lined with shelves and hooks and things.").
  978. Connect(r_valley12, r_shed, D_NORTH).
  979. Connect(r_valley12, r_shed, D_ENTER).
  980. AutoGraphics(r_shed, AutoClosedRoom).
  981. Scenery(r_shed, "shelves,shelf,hook,thing,tool;various,garden").
  982. AddTail(r_shed@p_rContents, o_fakeDoor).
  983. define tp_squirrel o_hoe CreateThing(nil).
  984. SetupObject(o_hoe, r_shed, "hoe;garden",
  985.     "This implement is generally used for tilling a garden. It's angled "
  986.     "blade can cut the roots of weeds a couple of inches under the surface, "
  987.     "thus releasing the weed, and hopefully killing it.").
  988. define tp_squirrel proc hoeUse()status:
  989.     thing here, weed;
  990.  
  991.     here := Here();
  992.     if Parent(here) = r_indoors then
  993.     Print("Bashing the nice floor with that hoe will likely get someone "
  994.         "very upset!\n");
  995.     fail
  996.     elif here@p_rIsTrunk then
  997.     Print("You are not going to be able to chop down the magnificent oak "
  998.           "tree with a garden hoe!\n");
  999.     fail
  1000.     elif here@p_rIsBranch then
  1001.     Print("Hacking on the branch with the hoe will accomplish little "
  1002.           "besides damaging the bark.\n");
  1003.     fail
  1004.     elif FindChildOnList(here@p_rContents, o_weed) or
  1005.     FindChildOnList(Me()@p_pCarrying, o_weed)
  1006.     then
  1007.     Print("This area already looks pretty well hoed over.\n");
  1008.     fail
  1009.     else
  1010.     Print("Chop, chop. Tug, tug. You have uprooted a weed!\n");
  1011.     weed := CreateThing(o_weed);
  1012.     weed@p_oWhere := here;
  1013.     SetThingStatus(weed, ts_public);
  1014.     AddTail(here@p_rContents, weed);
  1015.     AddTail(squirrelThing@p_tapes, weed);
  1016.     succeed
  1017.     fi
  1018. corp;
  1019. o_hoe@p_oUseChecker := hoeUse.
  1020. define tp_squirrel proc doHoeUse()void:
  1021.     ignore hoeUse();
  1022. corp;
  1023. o_hoe@p_oActWord := "hoe,chop,tug".
  1024. o_hoe@p_oActAction := doHoeUse.
  1025. AddTail(squirrelThing@p_objects, o_hoe).
  1026. define tp_squirrel o_rake CreateThing(nil).
  1027. SetupObject(o_rake, r_shed, "rake;garden",
  1028.     "This rake is a wooden one, complete with wooden tines. The rake is "
  1029.     "used mainly for collecting the fallen leaves in the fall, but can also "
  1030.     "be used on a garden, to break up the pieces of sod.").
  1031. define tp_squirrel proc rakeUse()status:
  1032.     if Parent(Here()) = r_indoors then
  1033.     Print("No way! You would badly scratch the floor.\n");
  1034.     fail
  1035.     elif FindChildOnList(Here()@p_rContents, o_weed) then
  1036.     Print("OK, everything is now in a neat pile.\n");
  1037.     succeed
  1038.     else
  1039.     Print("There isn't much here to rake up.\n");
  1040.     succeed
  1041.     fi
  1042. corp;
  1043. o_rake@p_oUseChecker := rakeUse.
  1044. define tp_squirrel proc doRakeUse()void:
  1045.     ignore rakeUse();
  1046. corp;
  1047. o_rake@p_oActWord := "rake".
  1048. o_rake@p_oActAction := doRakeUse.
  1049. AddTail(squirrelThing@p_objects, o_rake).
  1050. define tp_squirrel o_fork CreateThing(nil).
  1051. SetupObject(o_fork, r_shed, "fork;garden",
  1052.     "The garden fork is used to dig over a garden. The long, widely separated "
  1053.     "tines can go deep into the ground, missing the roots of the vegetables "
  1054.     "being grown, and loosen the soil, thus allowing better aeration and "
  1055.     "moisture penetration.").
  1056. define tp_squirrel proc forkUse()status:
  1057.     if Parent(Here()) = r_indoors then
  1058.     Print("No forking indoors! It would chip the floor.\n");
  1059.     else
  1060.     Print("Quit forking around!\n");
  1061.     fi;
  1062.     fail
  1063. corp;
  1064. o_fork@p_oUseChecker := forkUse.
  1065. define tp_squirrel proc doForkUse()void:
  1066.     ignore forkUse();
  1067. corp;
  1068. o_fork@p_oActWord := "fork".
  1069. o_fork@p_oActAction := doForkUse.
  1070. AddTail(squirrelThing@p_objects, o_fork).
  1071. define tp_squirrel o_tapeDispenser CreateThing(nil).
  1072. SetupObject(o_tapeDispenser, r_shed, "dispenser;bug,tape",
  1073.     "The bug tape dispenser is attached to the back wall of the shed. It "
  1074.     "holds a roll of wide tape which is covered in a sticky insect repellant. "
  1075.     "The tape is usually wrapped around tree trunks to keep bugs like "
  1076.     "caterpillars and ants from climbing up them and doing damage.").
  1077. o_tapeDispenser@p_oSmellString :=
  1078.     "The dispenser has no smell, but the tape itself smells icky.".
  1079. o_tapeDispenser@p_oTouchString :=
  1080.    "You feel nothing special about the dispenser, but the bug tape is sticky.".
  1081. /* o_bugTape is defined earlier */
  1082. SetThingStatus(o_bugTape, ts_readonly).
  1083. o_bugTape@p_oName := "tape;short,piece,of,sticky,bug".
  1084. o_bugTape@p_oDesc :=
  1085.     "The piece of bug tape is quite tricky to handle - it seems to want to "
  1086.     "wrap itself all around you!".
  1087. define tp_squirrel proc tapeDrop(thing th)status:
  1088.     Print("Dropping the bug tape here would just make a mess. Try using it "
  1089.     "somewhere appropriate.");
  1090.     fail
  1091. corp;
  1092. o_bugTape@p_oDropChecker := tapeDrop.
  1093. define tp_squirrel proc tapeUse()status:
  1094.     thing here, it, me, there;
  1095.     int dir, foundDir;
  1096.  
  1097.     here := Here();
  1098.     it := It();
  1099.     me := Me();
  1100.     if here@p_rIsTrunk then
  1101.     Print("The piece of bug tape that you have is not long enough to "
  1102.         "reach around the trunk. You struggle against gravity to wrap "
  1103.         "it partly around the trunk, but it begins to get the best of "
  1104.         "you and starts sticking to you. After a valiant struggle, you "
  1105.         "get it off of yourself, but you have turned it into a useless, "
  1106.         "sticky wad.\n");
  1107.     ClearThing(it);
  1108.     DelElement(me@p_pCarrying, it);
  1109.     it := CreateThing(o_wad);
  1110.     SetThingStatus(it, ts_public);
  1111.     GiveThing(it, SysAdmin);
  1112.     AddTail(me@p_pCarrying, it);
  1113.     succeed
  1114.     elif here@p_rIsBranch then
  1115.     AddTail(here@p_rContents, it);
  1116.     it -- p_oCarryer;
  1117.     it@p_oWhere := here;
  1118.     DelElement(me@p_pCarrying, it);
  1119.     AddTail(squirrelThing@p_tapes, it);
  1120.     if squirrelThing@p_rFirstWrap then
  1121.         Print("The bug tape is not long enough to go all of the way "
  1122.         "around the branch, but it is long enough to cover the top "
  1123.         "of the branch and go part way down the sides. Aided by "
  1124.         "gravity, it looks like it will stay there for a while. "
  1125.         "In applying the bug tape to the branch, you back up towards "
  1126.         "the trunk of the tree.\n");
  1127.         squirrelThing@p_rFirstWrap := false;
  1128.     else
  1129.         Print("You apply the bug tape to the branch here and back up "
  1130.         "towards the trunk.\n");
  1131.     fi;
  1132.     /* This code KNOWS that a branch location will either have only one
  1133.        direction to go from it, or will be 1 away from the trunk. This
  1134.        could just be a 'for' loop, but we speed it up a bit in the
  1135.        case of being next to the trunk by exiting as soon as we have
  1136.        found the direction to go. */
  1137.     dir := D_NORTH;
  1138.     foundDir := D_UP;
  1139.     while
  1140.         there := here@(DirProp(dir));
  1141.         if there ~= nil then
  1142.         if there@p_rIsTrunk then
  1143.             foundDir := dir;
  1144.             false
  1145.         elif foundDir = D_UP then
  1146.             foundDir := dir;
  1147.             dir ~= D_NORTHWEST
  1148.         else
  1149.             dir ~= D_NORTHWEST
  1150.         fi
  1151.         else
  1152.         dir ~= D_NORTHWEST
  1153.         fi
  1154.     do
  1155.         dir := dir + 1;
  1156.     od;
  1157.     /* do not just use EnterRoom - want the leave checker done */
  1158.     ignore Parse(G, "go " + ExitName(foundDir));
  1159.     succeed
  1160.     else
  1161.     Print("There is nothing here that you can usefully wrap the bug "
  1162.         "tape around.\n");
  1163.     fail
  1164.     fi
  1165. corp;
  1166. o_bugTape@p_oUseChecker := tapeUse.
  1167. define tp_squirrel proc doTapeUse()void:
  1168.     ignore tapeUse();
  1169. corp;
  1170. o_bugTape@p_oActWord := "tape,wrap,stick,attach".
  1171. o_bugTape@p_oActAction := doTapeUse.
  1172. define tp_squirrel proc dispenserGet(thing tape)status:
  1173.  
  1174.     if FindChildOnList(Me()@p_pCarrying, o_bugTape) then
  1175.     Print("Trying to deal with two pieces of the sticky bug tape at a "
  1176.         "time would just result in you getting yourself all stuck up. "
  1177.         "Use your first piece before getting another.\n");
  1178.     fail
  1179.     else
  1180.     Print("You can't get the tape dispenser, since it is fastened to the "
  1181.         "wall, but you do manage to tear off a short piece of the "
  1182.         "bug tape.\n");
  1183.     tape := CreateThing(o_bugTape);
  1184.     SetThingStatus(tape, ts_public);
  1185.     GiveThing(tape, SysAdmin);
  1186.     tape@p_oCarryer := Me();
  1187.     AddTail(Me()@p_pCarrying, tape);
  1188.     succeed
  1189.     fi
  1190. corp;
  1191. o_bugTape@p_oSmellString := "The bug tape smells icky.".
  1192. o_bugTape@p_oTouchString := "The bug tape is sticky.".
  1193. o_tapeDispenser@p_oGetChecker := dispenserGet.
  1194. o_tapeDispenser@p_oUseChecker := dispenserGet.
  1195. define tp_squirrel proc doDispenserUse()void:
  1196.     ignore dispenserGet(It());
  1197. corp;
  1198. o_tapeDispenser@p_oActWord := "dispense".
  1199. o_tapeDispenser@p_oActAction := doDispenserUse.
  1200. define tp_squirrel proc fakeTapeGet(thing tape)status:
  1201.     thing me;
  1202.     list thing carrying;
  1203.  
  1204.     me := Me();
  1205.     carrying := me@p_pCarrying;
  1206.     if FindChildOnList(carrying, o_bugTape) then
  1207.     Print("Trying to deal with two pieces of the sticky bug tape at a "
  1208.         "time would just result in you getting yourself all stuck up. "
  1209.         "Use your first piece before getting another.\n");
  1210.     fail
  1211.     elif HasAdjective(ItName(), "long") or HasAdjective(ItName(), "longer")
  1212.     then
  1213.     Print("You tear off a long piece of the bug tape. Unfortunately, it "
  1214.         "is longer than you can easily handle, and it starts to stick "
  1215.         "to you. After a lengthy battle you subdue it, but you have "
  1216.         "reduced it to a sticky wad.\n");
  1217.     tape := CreateThing(o_wad);
  1218.     SetThingStatus(tape, ts_public);
  1219.     GiveThing(tape, SysAdmin);
  1220.     tape@p_oCarryer := me;
  1221.     AddTail(carrying, tape);
  1222.     succeed
  1223.     else
  1224.     tape := CreateThing(o_bugTape);
  1225.     SetThingStatus(tape, ts_public);
  1226.     if CarryItem(tape) then
  1227.         Print("You tear off a short piece of the bug tape.\n");
  1228.         succeed
  1229.     else
  1230.         ClearThing(tape);
  1231.         fail
  1232.     fi
  1233.     fi
  1234. corp;
  1235. define tp_squirrel o_fakeTape CreateThing(nil).
  1236. FakeObject(o_fakeTape, r_shed,
  1237.     "tape;piece,of,sticky,bug.tape;short,long,longer,piece,of,sticky,bug",
  1238.     "The bug tape is neatly wrapped up in the dispenser.").
  1239. o_fakeTape -- p_oNotGettable;
  1240. o_fakeTape@p_oGetChecker := fakeTapeGet.
  1241. o_fakeTape@p_oSmellString := "The bug tape smells icky.".
  1242. o_fakeTape@p_oTouchString := "The bug tape is sticky.".
  1243. /* o_wad is defined earlier */
  1244. define tp_squirrel proc wadDrop(thing it)status:
  1245.     thing here;
  1246.  
  1247.     here := Here();
  1248.     if Parent(here) = r_indoors then
  1249.     Print("Don't drop it here! You'll just make an awful mess!\n");
  1250.     fail
  1251.     else
  1252.     AddTail(here@p_rContents, it);
  1253.     DelElement(Me()@p_pCarrying, it);
  1254.     it -- p_oCarryer;
  1255.     it@p_oWhere := here;
  1256.     AddTail(squirrelThing@p_tapes, it);
  1257.     if here@p_rIsTrunk or here@p_rIsBranch then
  1258.         Print("You drop the sticky wad, which immediately sticks to the "
  1259.         "tree and stays put. It doesn't block passage, however.\n");
  1260.         succeed
  1261.     else
  1262.         Print("You drop the sticky wad onto the ground. It hits with a "
  1263.         "sodden thump and looks to be there forever.\n");
  1264.         succeed
  1265.     fi
  1266.     fi
  1267. corp;
  1268. define tp_squirrel proc wadGet(thing wad)status:
  1269.     if Here()@p_rIsTrunk or Here()@p_rIsBranch then
  1270.     Print("The sticky wad is stuck tightly to the tree. You cannot pry "
  1271.         "it loose.\n");
  1272.     else
  1273.     Print("The sticky wad is stuck tightly to the ground. You cannot "
  1274.         "pry it up.\n");
  1275.     fi;
  1276.     fail
  1277. corp;
  1278. SetThingStatus(o_wad, ts_readonly).
  1279. o_wad@p_oName := "wad;sticky".
  1280. o_wad@p_oDesc :=
  1281.     "The sticky wad is roughly spherical, and about two inches across. It "
  1282.     "is brown, smells icky, and tends to stick to everything, including you.".
  1283. o_wad@p_oDropChecker := wadDrop.
  1284. o_wad@p_oGetChecker := wadGet.
  1285. o_wad@p_oUseString :=
  1286.     "The sticky wad used to have a use, before you got it all wadded up, "
  1287.     "but now it is pretty useless.".
  1288. o_wad@p_oActWord := "tape,wrap,stick,attach".
  1289. o_wad@p_oActString :=
  1290.     "The sticky wad used to have a use, before you got it all wadded up, "
  1291.     "but now it is pretty useless.".
  1292. o_wad@p_oSmellString := "The sticky wad smells icky.".
  1293. o_wad@p_oTouchString := "The sticky wad is sticky.".
  1294. define tp_squirrel o_bugSpray CreateThing(nil).
  1295. SetupObject(o_bugSpray, r_shed, "squirter,sprayer;bug",
  1296.     "The bug squirter is a hand operated aerosol device which sprays a mist "
  1297.     "of insecticide wherever it is pointed. The jar of insecticide attached "
  1298.     "to it is full.").
  1299. o_bugSpray@p_oUseString := "Squirt! Squirt!".
  1300. o_bugSpray@p_oActWord := "squirt,spray".
  1301. o_bugSpray@p_oActString := "Squirt! Squirt!".
  1302. o_bugSpray@p_oEatString := "NO! It's almost certainly poisonous!".
  1303. o_bugSpray@p_oSmellString :=
  1304.     "The sprayer itself smells slightly metallic, but the insecticide in "
  1305.     "the jar has a strong chemical smell.".
  1306. AddTail(squirrelThing@p_objects, o_bugSpray).
  1307.  
  1308. define tp_squirrel o_oakTree2 CreateThing(o_oakTree).
  1309. o_oakTree2@p_oDesc :=
  1310.     "From this close up, the oak tree is somewhat overwhelming. The trunk is "
  1311.     "about four feet thick at this point, and the branches just overhead "
  1312.     "are nearly two feet thick. The ridges in the bark here are a couple "
  1313.     "of inches deep, and there is a lot of thick moss covering one side "
  1314.     "of the trunk. It is quite peaceful here.".
  1315. /* r_valley13 defined earlier */
  1316. SetupRoom(r_valley13, "in the shade of the magnificent old oak",
  1317.     "Very little light hits this cool spot in the middle of the valley. The "
  1318.     "oak is right beside you and it looks like even you could climb up it.").
  1319. Connect(r_valley3, r_valley13, D_NORTHEAST).
  1320. Connect(r_valley4, r_valley13, D_NORTH).
  1321. Connect(r_valley5, r_valley13, D_NORTHWEST).
  1322. Connect(r_valley6, r_valley13, D_EAST).
  1323. Connect(r_valley7, r_valley13, D_WEST).
  1324. Connect(r_valley8, r_valley13, D_SOUTHEAST).
  1325. Connect(r_valley9, r_valley13, D_SOUTH).
  1326. Connect(r_valley10, r_valley13, D_SOUTHWEST).
  1327. define tp_squirrel SQ_VALLEY13_ID NextEffectId().
  1328. define tp_squirrel proc valley13Draw()void:
  1329.  
  1330.     if not KnowsEffect(nil, SQ_VALLEY13_ID) then
  1331.     DefineEffect(nil, SQ_VALLEY13_ID);
  1332.     GSetImage(nil, "sq_valley13");
  1333.     IfFound(nil);
  1334.         GShowImage(nil, "", 0, 0, 160, 100, 0, 0);
  1335.     Else(nil);
  1336.         AutoOpenSpace();
  1337.         GSetPen(nil, C_FOREST_GREEN);
  1338.         GAMove(nil, 80, 50);
  1339.         GEllipse(nil, 70, 40, true);
  1340.     Fi(nil);
  1341.     EndEffect();
  1342.     fi;
  1343.     CallEffect(nil, SQ_VALLEY13_ID);
  1344. corp;
  1345. AutoGraphics(r_valley13, valley13Draw).
  1346. AddTail(r_valley13@p_rContents, o_oakTree2).
  1347. r_valley13@p_rIsTrunk := true.
  1348.  
  1349.  
  1350. /* And now the tree */
  1351.  
  1352. define tp_squirrel proc treeDrop(thing object)status:
  1353.  
  1354.     Print("You drop the " + FormatName(object@p_oName) +
  1355.     " which disappears out of sight.\n");
  1356.     /* Note that this will result in two calls of any drop action on the
  1357.        object itself. This presumeably will not matter, since the call
  1358.        that has already happened returned 'continue' for us to get here. */
  1359.     ignore DoDrop(r_valley13, Me(), object);
  1360.     succeed
  1361. corp;
  1362.  
  1363. define tp_squirrel r_trunk CreateThing(r_outdoors).
  1364. SetThingStatus(r_trunk, ts_readonly).
  1365. r_trunk@p_rName := "holding on to the tree trunk".
  1366. r_trunk@p_rIsTrunk := true.
  1367. r_trunk@p_rNoGoString := "It would be a long, bumpy fall to the ground!".
  1368. AddRoomDropChecker(r_trunk, treeDrop, false).
  1369. AutoGraphics(r_trunk, AutoPaths).
  1370. AutoPens(r_trunk, C_FOREST_GREEN, C_BROWN, 0, 0).
  1371.  
  1372. define tp_squirrel o_fakeTrunk CreateThing(nil).
  1373. FakeModel(o_fakeTrunk, "trunk,tree;big,rough,brown,magnificent,old,oak,tree",
  1374.     "With your nose almost pressed into it, the tree trunk just looks "
  1375.     "very big, very brown, and very rough.").
  1376.  
  1377. define tp_squirrel o_fakeBranch CreateThing(nil).
  1378. FakeModel(o_fakeBranch, "branch;brown,woody,leafy,high,tree",
  1379.     "From this close up, the branches just look rough, brown, woody and "
  1380.     "a long way from the ground.").
  1381.  
  1382. define tp_squirrel proc makeTrunk(string desc)thing:
  1383.     thing trunk;
  1384.  
  1385.     trunk := CreateThing(r_trunk);
  1386.     trunk@p_rDesc := desc;
  1387.     trunk@p_rContents := CreateThingList();
  1388.     SetThingStatus(trunk, ts_readonly);
  1389.     AddTail(trunk@p_rContents, o_fakeTrunk);
  1390.     AddTail(trunk@p_rContents, o_fakeBranch);
  1391.     trunk
  1392. corp;
  1393.  
  1394. define tp_squirrel r_trunk1 makeTrunk("Large branches go east and west.").
  1395. HUniConnect(r_valley13, r_trunk1, D_UP).
  1396. UniConnect(r_trunk1, r_valley13, D_DOWN).
  1397.  
  1398. define tp_squirrel r_trunk2 makeTrunk(
  1399.     "A large branch goes south and smaller ones go northeast and northwest.").
  1400. Connect(r_trunk1, r_trunk2, D_UP).
  1401.  
  1402. define tp_squirrel r_trunk3 makeTrunk(
  1403.     "A large branch goes north and smaller ones go west, southwest and "
  1404.     "southeast.").
  1405. Connect(r_trunk2, r_trunk3, D_UP).
  1406.  
  1407. define tp_squirrel r_trunk4 makeTrunk(
  1408.     "You are now quite high up the tree. Someone has managed to wrap some "
  1409.     "bug tape completely around the tree here, so progress higher is blocked. "
  1410.     "Large branches go east and west, and a smaller one goes northeast.").
  1411. Connect(r_trunk3, r_trunk4, D_UP).
  1412. r_trunk4@p_rTopTrunk := true.
  1413. define tp_squirrel o_tape2 CreateThing(nil).
  1414. FakeObject(o_tape2, r_trunk4,
  1415.     "tape;long,piece,of,sticky,bug.tape;longer,piece,of,sticky,bug",
  1416.     "This long piece of bug tape is wrapped securely around the tree trunk.").
  1417. define tp_squirrel proc tapeGet2(thing tape)status:
  1418.     Print("The bug tape is firmly wrapped around the trunk - you cannot "
  1419.     "remove it.\n");
  1420.     fail
  1421. corp;
  1422. o_tape2@p_oGetChecker := tapeGet2.
  1423.  
  1424. define tp_squirrel r_trunk5 CreateThing(nil).
  1425. r_trunk4@p_rUp := r_trunk5.
  1426. define tp_squirrel proc noClimb()status:
  1427.     Print("There is no way you are going to climb up over that "
  1428.     "sticky bug tape!\n");
  1429.     fail
  1430. corp;
  1431. AddUpChecker(r_trunk4, noClimb, false).
  1432.  
  1433. define tp_squirrel r_branch CreateThing(r_outdoors).
  1434. SetThingStatus(r_branch, ts_readonly).
  1435. r_branch@p_rName := "crawling along a branch".
  1436. r_branch@p_rDesc := "The branch ends here.".
  1437. r_branch@p_rIsBranch := true.
  1438. r_branch@p_rNoGoString := "Walking on air is not your strong point!".
  1439. AddRoomDropChecker(r_branch, treeDrop, false).
  1440. AutoGraphics(r_branch, AutoPaths).
  1441. AutoPens(r_branch, C_FOREST_GREEN, C_BROWN, 0, 0).
  1442.  
  1443. define tp_squirrel o_fakeTrunk2 CreateThing(nil).
  1444. FakeModel(o_fakeTrunk2, "trunk,tree;big,rough,brown,magnificent,old,oak,tree",
  1445.     "From out here, the tree trunk looks very inviting.").
  1446.  
  1447. define tp_squirrel proc makeBranch(string desc; thing escape)thing:
  1448.     thing branch;
  1449.  
  1450.     branch := CreateThing(r_branch);
  1451.     if desc ~= "" then
  1452.     branch@p_rDesc := desc;
  1453.     fi;
  1454.     branch@p_rContents := CreateThingList();
  1455.     if escape ~= nil then
  1456.     branch@p_rSquirrelPath := escape;
  1457.     fi;
  1458.     SetThingStatus(branch, ts_readonly);
  1459.     AddTail(branch@p_rContents, o_fakeBranch);
  1460.     AddTail(branch@p_rContents, o_fakeTrunk2);
  1461.     branch
  1462. corp;
  1463.  
  1464. define tp_squirrel r_branch1 makeBranch(
  1465.     "This large branch is west of the trunk. Smaller branches lead "
  1466.     "north and southwest.", r_valley13).
  1467. Connect(r_trunk1, r_branch1, D_WEST).
  1468.  
  1469. define tp_squirrel r_branch2 makeBranch("", r_valley13).
  1470. Connect(r_branch1, r_branch2, D_SOUTHWEST).
  1471.  
  1472. define tp_squirrel r_branch3 makeBranch("", r_valley13).
  1473. Connect(r_branch1, r_branch3, D_NORTH).
  1474.  
  1475. define tp_squirrel r_branch4 makeBranch(
  1476.     "This large branch is east of the trunk. Smaller branches lead "
  1477.     "northeast and southeast.", r_valley13).
  1478. Connect(r_trunk1, r_branch4, D_EAST).
  1479.  
  1480. define tp_squirrel r_branch5 makeBranch("", r_valley13).
  1481. Connect(r_branch4, r_branch5, D_SOUTHEAST).
  1482.  
  1483. define tp_squirrel r_branch6 makeBranch("", r_valley13).
  1484. Connect(r_branch4, r_branch6, D_NORTHEAST).
  1485.  
  1486. define tp_squirrel r_branch7 makeBranch("", r_branch3).
  1487. Connect(r_trunk2, r_branch7, D_NORTHWEST).
  1488.  
  1489. define tp_squirrel r_branch8 makeBranch(
  1490.     "The branch bends here, with the trunk back to the southwest and more "
  1491.     "branch to the east.", r_branch6).
  1492. Connect(r_trunk2, r_branch8, D_NORTHEAST).
  1493.  
  1494. define tp_squirrel r_branch9 makeBranch("", r_branch6).
  1495. Connect(r_branch8, r_branch9, D_EAST).
  1496.  
  1497. define tp_squirrel r_branch10 makeBranch(
  1498.     "This large branch is south of the trunk. Smaller branches lead "
  1499.     "southeast and southwest.", r_branch2).
  1500. Connect(r_trunk2, r_branch10, D_SOUTH).
  1501.  
  1502. define tp_squirrel r_branch11 makeBranch("", r_branch2).
  1503. Connect(r_branch10, r_branch11, D_SOUTHWEST).
  1504.  
  1505. define tp_squirrel r_branch12 makeBranch("", r_branch5).
  1506. Connect(r_branch10, r_branch12, D_SOUTHEAST).
  1507.  
  1508. define tp_squirrel r_branch13 makeBranch(
  1509.     "The branch bends here, with the trunk back to the northeast and more "
  1510.     "branch to the south.", r_branch11).
  1511. Connect(r_trunk3, r_branch13, D_SOUTHWEST).
  1512.  
  1513. define tp_squirrel r_branch14 makeBranch("", r_branch2).
  1514. Connect(r_branch13, r_branch14, D_SOUTH).
  1515.  
  1516. define tp_squirrel r_branch15 makeBranch("", r_branch7).
  1517. Connect(r_trunk3, r_branch15, D_WEST).
  1518.  
  1519. define tp_squirrel r_branch16 makeBranch("", r_branch12).
  1520. Connect(r_trunk3, r_branch16, D_SOUTHEAST).
  1521.  
  1522. define tp_squirrel r_branch17 makeBranch(
  1523.     "This large branch is north of the trunk. Smaller branches lead "
  1524.     "northwest and east.", r_branch7).
  1525. Connect(r_trunk3, r_branch17, D_NORTH).
  1526.  
  1527. define tp_squirrel r_branch18 makeBranch("", r_branch7).
  1528. Connect(r_branch17, r_branch18, D_NORTHWEST).
  1529.  
  1530. define tp_squirrel r_branch19 makeBranch("", r_branch9).
  1531. Connect(r_branch17, r_branch19, D_EAST).
  1532.  
  1533. define tp_squirrel r_branch20 makeBranch(
  1534.     "The branch bends here, with the trunk back to the east and more branch "
  1535.     "to the southwest.", r_branch15).
  1536. Connect(r_trunk4, r_branch20, D_WEST).
  1537.  
  1538. define tp_squirrel r_branch21 makeBranch("", r_branch15).
  1539. Connect(r_branch20, r_branch21, D_SOUTHWEST).
  1540.  
  1541. define tp_squirrel r_branch22 makeBranch("", r_branch19).
  1542. Connect(r_trunk4, r_branch22, D_NORTHEAST).
  1543. r_trunk4@p_rSquirrelPath := r_branch22.
  1544.  
  1545. define tp_squirrel r_branch23 makeBranch(
  1546.     "This very long branch runs east-west at this point.", r_branch19).
  1547. Connect(r_trunk4, r_branch23, D_EAST).
  1548.  
  1549. define tp_squirrel r_branch24 makeBranch(
  1550.     "The branch has been broken off here - there are no other branches nearby "
  1551.     "and you can only go back west towards the trunk.", nil).
  1552. Connect(r_branch23, r_branch24, D_EAST).
  1553.  
  1554. unuse tp_squirrel
  1555. unuse t_streets
  1556.